package com.losdun.product.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author sword.ye
 * @date 2025/6/15
 **/
@Getter
@AllArgsConstructor
public enum UnitsEnum {
    SQUARE_METER("㎡","平方米"),
    METER("m","米"),
    SET("套","套"),
    ONE("个","个")
    ;

    private String code;
    private String label;

    public static String getCodeByLabel(String label) {
        for (UnitsEnum unitsEnum : UnitsEnum.values()) {
            if (unitsEnum.getLabel().equals(label)) {
                return unitsEnum.getCode();
            }
        }
        return label;
    }
}
